home *** CD-ROM | disk | FTP | other *** search
/ Star Trek Starfleet Academy Mini Omnipedia / MINI_OMNI.ISO / pc / omni_v2.dxr / 00386_MIAW handlers continued.ls < prev    next >
Encoding:
Text File  |  1996-04-15  |  9.1 KB  |  283 lines

  1. global gMyWinList, gTheWindowRect, gMyQTwindow, gQTWinActive, gwinCheck, gWinListNum, gTheName, gTheNewWinht, gTheNewWinwd, gMyWinTracker, gMyWindow, gtheLockList, gImageList, gthumbn1spr, gthumbn2spr, gthumbn3spr, gthumbn4spr, gthumbn5spr, gVideoName, gPDL, gtheWord, gWinType, gNewCaption, gCaptionList, gAssetPath, gComputerTypeK, gthumbholdcst, gTrekCursor, oWinKey, gModeState, gActiveResTopWin, gActiveTopWin, gMacColorIsHere, gWinTypeList, gActiveWin, glinktostagemsg, gLockWinStorage, oPWin, gVidIsPlaying, gWinOffSet, gLastWinLeft, gLastWinTop, gSpriteList, gWinLocRootT, gWinLocRootL, gWinLocCounter, gLastResWinLeft, gLastResWinTop
  2.  
  3. on hActivateMIAW theTitleFile, n
  4.   cursor(4)
  5.   setaProp(gMyWinList, n, theTitleFile)
  6.   set the windowType of window getAt(gMyWinList, n) to gWinType
  7.   set the title of window getAt(gMyWinList, n) to EMPTY
  8.   set theSL to gLastWinLeft
  9.   set theST to gLastWinTop
  10.   if (n > 0) and (n < 11) then
  11.     hSetThePict()
  12.     set thewinht to gTheNewWinht
  13.     set thewinwd to gTheNewWinwd
  14.     set offSetL to theSL
  15.     set offSetT to theST
  16.   else
  17.     hSetTheVideo()
  18.     set thewinht to 212
  19.     set thewinwd to 272
  20.     set offSetL to 362
  21.     set offSetT to 197
  22.   end if
  23.   set theRect to rect(offSetL, offSetT, thewinwd + offSetL, thewinht + offSetT)
  24.   set the rect of window getAt(gMyWinList, n) to theRect
  25.   cursor([gTrekCursor, gTrekCursor + 1])
  26. end
  27.  
  28. on hgetCaption
  29.   set gCaptionList to [:]
  30.   sort(gCaptionList)
  31.   set vwhichlist to hCapitalize(char 1 of gTheName)
  32.   set vwhichlist to charToNum(vwhichlist)
  33.   if vwhichlist <= charToNum("D") then
  34.     set gCaptionList to value(the text of cast "Captxt_1")
  35.   else
  36.     if (vwhichlist >= charToNum("E")) and (vwhichlist <= charToNum("N")) then
  37.       set gCaptionList to value(the text of cast "Captxt_2")
  38.     else
  39.       if (vwhichlist >= charToNum("O")) and (vwhichlist <= charToNum("U")) then
  40.         set gCaptionList to value(the text of cast "Captxt_3")
  41.       else
  42.         if (vwhichlist >= charToNum("V")) and (vwhichlist <= charToNum("Z")) then
  43.           set gCaptionList to value(the text of cast "Captxt_4")
  44.         end if
  45.       end if
  46.     end if
  47.   end if
  48.   if not objectp(gCaptionList) then
  49.   end if
  50.   set gNewCaption to getaProp(gCaptionList, gTheName)
  51.   if voidp(gNewCaption) then
  52.     set gNewCaption to "  "
  53.   end if
  54. end
  55.  
  56. on hGetVidCap
  57.   set gCaptionList to [:]
  58.   sort(gCaptionList)
  59.   set gCaptionList to value(the text of cast "Captxt_Vid")
  60.   if not objectp(gCaptionList) then
  61.   end if
  62.   set gNewCaption to getaProp(gCaptionList, gTheName)
  63.   if voidp(gNewCaption) then
  64.     set gNewCaption to "  "
  65.   end if
  66. end
  67.  
  68. on hGetResCap
  69.   set gCaptionList to [:]
  70.   sort(gCaptionList)
  71.   set gCaptionList to value(the text of cast "Captxt_res")
  72.   if not objectp(gCaptionList) then
  73.   end if
  74.   set gNewCaption to getaProp(gCaptionList, gTheName)
  75.   if voidp(gNewCaption) then
  76.     set gNewCaption to "  "
  77.   end if
  78. end
  79.  
  80. on hSetThePict
  81.   tell window getAt(gMyWinList, gWinListNum)
  82.     mSetBlankCast(oPWin)
  83.   end tell
  84.   tell window getAt(gMyWinList, gWinListNum)
  85.     mDisplayPict(oPWin)
  86.   end tell
  87. end
  88.  
  89. on hSetTheVideo
  90.   tell window getAt(gMyWinList, gWinListNum)
  91.     hDisplayVideo()
  92.   end tell
  93. end
  94.  
  95. on hRestorePicon pIndexNum
  96.   global gPicWinNum, gthumbnRefspr
  97.   if not ((getAt(gWinTypeList, value(gPicWinNum)) = #Resources) or (getAt(gWinTypeList, value(gPicWinNum)) = #CLOSED)) then
  98.     set vImToFind to getAt(gImageList, value(gPicWinNum))
  99.     repeat with aa = gthumbn1spr to gthumbn5spr
  100.       set LpiconName to chars(the name of cast the castNum of sprite aa, 1, 7)
  101.       if LpiconName = vImToFind then
  102.         set the visible of sprite getAt(gSpriteList, value(gPicWinNum)) to 1
  103.       end if
  104.     end repeat
  105.   end if
  106. end
  107.  
  108. on hHideOpenPicons
  109.   repeat with bb = gthumbn1spr to gthumbn5spr
  110.     set Lmynum to the castNum of sprite bb
  111.     if Lmynum = gthumbholdcst then
  112.       exit
  113.     end if
  114.     set LpiconName to chars(the name of cast Lmynum, 1, 7)
  115.     repeat with yy = 1 to 10
  116.       if LpiconName = getAt(gImageList, yy) then
  117.         set the visible of sprite bb to 0
  118.       end if
  119.     end repeat
  120.   end repeat
  121. end
  122.  
  123. on hFindCaptionWord
  124.   if gtheWord <> EMPTY then
  125.     set gtheWord to hcleanup(gtheWord)
  126.     set the text of cast "SearchTextCandidate" to string(gtheWord)
  127.     set the selStart to 0
  128.     set the selEnd to the number of chars in gtheWord
  129.   end if
  130. end
  131.  
  132. on hFindCaptionLine
  133.   global gtheLine
  134.   if gtheLine <> EMPTY then
  135.     set vtheLineLength to the number of chars in gtheLine
  136.     if charToNum(char vtheLineLength of gtheLine) = 9 then
  137.       set vtheLineLength to vtheLineLength - 1
  138.       set gtheLine to chars(gtheLine, 1, vtheLineLength)
  139.     end if
  140.     set vtheLineLength to the number of chars in gtheLine
  141.     set vLessFive to vtheLineLength - 5
  142.     set vChunk to chars(gtheLine, vLessFive, vtheLineLength)
  143.     if (vChunk contains "TOS") or (vChunk contains "TNG") or (vChunk contains "DS9") or (vChunk contains "VGR") then
  144.       set gtheLine to char 1 to vLessFive of gtheLine
  145.     end if
  146.     set gtheLine to hcleanup(gtheLine)
  147.     set the text of cast "SearchTextCandidate" to string(gtheLine)
  148.     set the selStart to 0
  149.     set the selEnd to the number of chars in gtheLine
  150.   end if
  151. end
  152.  
  153. on ShowMe
  154.   put "gImageList = " & gImageList
  155.   put "gWinListNum S = " & gWinListNum
  156.   put "gMyWinTracker = " & gMyWinTracker
  157.   put "gMyWinList = " & gMyWinList
  158.   put "gtheLockList = " & gtheLockList
  159.   put "The WindowList = " & the windowList
  160. end
  161.  
  162. on hClearWindows
  163.   set the windowList to []
  164. end
  165.  
  166. on hOpenResourcePict pResPictName
  167.   hOpenWhichResImage(pResPictName)
  168.   hGetPICTWinNum()
  169.   updateStage()
  170.   hGetResCap()
  171.   if getAt(gMyWinTracker, gWinListNum) = 0 then
  172.     if (gWinListNum > 0) and (gWinListNum < 11) then
  173.       hActivateResMIAW(the pathName & "BL" & gPDL & gWinListNum & "PicWn.dir", gWinListNum)
  174.     end if
  175.     set vNewWinName to getAt(gMyWinList, gWinListNum)
  176.     open(window vNewWinName)
  177.     hCallOmniColor()
  178.     moveToFront(window vNewWinName)
  179.     tell window vNewWinName
  180.       mStartUp(oPWin)
  181.     end tell
  182.     tell window vNewWinName
  183.       mSetbasicWinKeys(oWinKey, window vNewWinName)
  184.     end tell
  185.     tell window vNewWinName
  186.       mSetBasicMouseUp(oWinKey, window vNewWinName)
  187.     end tell
  188.     set gLastResWinLeft to getAt(the rect of window vNewWinName, 1) + gWinOffSet
  189.     set gLastResWinTop to getAt(the rect of window vNewWinName, 2) + gWinOffSet
  190.     tell window vNewWinName
  191.       mSetbasicWinKeys(oWinKey, window vNewWinName)
  192.     end tell
  193.     hCheckWinLocCounter()
  194.   end if
  195. end
  196.  
  197. on hCallOmniColor
  198.   if gComputerTypeK = #mac then
  199.     OmniColor()
  200.   end if
  201. end
  202.  
  203. on hActivateResMIAW theTitleFile, n
  204.   cursor(4)
  205.   setaProp(gMyWinList, n, theTitleFile)
  206.   set the windowType of window getAt(gMyWinList, n) to gWinType
  207.   set the title of window getAt(gMyWinList, n) to EMPTY
  208.   set theSL to gLastResWinLeft
  209.   set theST to gLastResWinTop
  210.   if (n > 0) and (n < 11) then
  211.     hSetThePict()
  212.     set thewinht to gTheNewWinht
  213.     set thewinwd to gTheNewWinwd
  214.     set offSetL to theSL
  215.     set offSetT to theST
  216.   end if
  217.   set theRect to rect(offSetL, offSetT, thewinwd + offSetL, thewinht + offSetT)
  218.   if (getAt(theRect, 3) > 640) and (getAt(theRect, 4) > 480) then
  219.     set vOffsetH to getAt(theRect, 3) - 630
  220.     set vOffsetV to getAt(theRect, 3) - 470
  221.     set theRect to rect(offSetL - vOffsetH, offSetT - vOffsetV, thewinwd + offSetL - vOffsetH, thewinht + offSetT - vOffsetV)
  222.   else
  223.     if getAt(theRect, 3) > 640 then
  224.       set vOffsetH to getAt(theRect, 3) - 630
  225.       set theRect to rect(offSetL - vOffsetH, offSetT, thewinwd + offSetL - vOffsetH, thewinht + offSetT)
  226.     else
  227.       if getAt(theRect, 4) > 480 then
  228.         set vOffsetV to getAt(theRect, 3) - 470
  229.         set theRect to rect(offSetL, offSetT - vOffsetV, thewinwd + offSetL, thewinht + offSetT - vOffsetV)
  230.       end if
  231.     end if
  232.   end if
  233.   set the rect of window getAt(gMyWinList, n) to theRect
  234.   cursor([gTrekCursor, gTrekCursor + 1])
  235. end
  236.  
  237. on hCheckWinLocCounter
  238.   if gWinLocCounter = 10 then
  239.     set gLastWinLeft to gWinLocRootL
  240.     set gLastWinTop to gWinLocRootT
  241.     set gLastResWinLeft to gWinLocRootL
  242.     set gLastResWinTop to gWinLocRootT
  243.     set gWinLocCounter to 1
  244.   else
  245.     set gWinLocCounter to gWinLocCounter + 1
  246.   end if
  247. end
  248.  
  249. on hdumpwinglobs
  250.   put "gMyWinList=" & gMyWinList
  251.   put "gTheWindowRect=" & gTheWindowRect
  252.   put "gMyQTwindow=" & gMyQTwindow
  253.   put "gQTWinActive=" & gQTWinActive
  254.   put "gwinCheck=" & gwinCheck
  255.   put "gWinListNum=" & gWinListNum
  256.   put "gTheName=" & gTheName
  257.   put "gTheNewWinht=" & gTheNewWinht
  258.   put "gTheNewWinwd=" & gTheNewWinwd
  259.   put "gMyWinTracker=" & gMyWinTracker
  260.   put "gMyWindow=" & gMyWindow
  261.   put "gtheLockList=" & gtheLockList
  262.   put "gImageList=" & gImageList
  263.   put "gTheWord=" & gtheWord
  264.   put "gWinType=" & gWinType
  265.   put "oWinkey=" & oWinKey
  266.   put "gActiveResTopWin=" & gActiveResTopWin
  267.   put "gActiveTopWin=" & gActiveTopWin
  268.   put "gWinTypeList=" & gWinTypeList
  269.   put "gActiveWin=" & gActiveWin
  270.   put "gLinkToStageMsg=" & glinktostagemsg
  271.   put "gLockWinStorage=" & gLockWinStorage
  272.   put "gVidIsPlaying=" & gVidIsPlaying
  273.   put "gWinOffset=" & gWinOffSet
  274.   put "gLastWinLeft=" & gLastWinLeft
  275.   put "gLastWinTop=" & gLastWinTop
  276.   put "gSpriteList=" & gSpriteList
  277.   put "gWinLocRootT=" & gWinLocRootT
  278.   put "gWinLocRootL=" & gWinLocRootL
  279.   put "gWinLocCounter=" & gWinLocCounter
  280.   put "gLastResWinLeft=" & gLastResWinLeft
  281.   put "gLastResWinTop=" & gLastResWinTop
  282. end
  283.